Skip to content

Throw ConfigIncludeDepthError with the limit and both paths when includes exceed depth 10 - #124

Merged
odrobnik merged 4 commits into
mainfrom
agent/issue-119
Nov 25, 2026
Merged

odrobnik merged 4 commits into
mainfrom
agent/issue-119

Conversation

@odrobnik

Copy link
Copy Markdown
Contributor

Resolves #119.

When a config include chain goes past git's 10-level limit, GitKit now throws a dedicated ConfigIncludeDepthError. It carries the limit, the file being included and the file that includes it, so a host can print git's "exceeded maximum include depth (10) while including … from …" message. This works for plain includes and for conditional includes read while checking hasconfig remote URLs. Other behaviour is unchanged: a missing target is still empty rather than an error, and a failed update leaves the config untouched. The full test suite passes locally. CI will run on the pull request, and SwiftPorts can drop its known-issue marker once this is released.

Oliver Drobnik and others added 2 commits November 25, 2026 10:54
…eventh include level

Both depth checks (file parse and hasconfig URL pre-scan) record the
included and including paths in a thread-local C record and set git's
'exceeded maximum include depth (10) while including ... from ...'
message; check() and the operation scope's reported failure turn the
matching Libgit2Error into the typed error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T09:57:55.779660Z bfd0dfa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfd0dfa406

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Oliver Drobnik and others added 2 commits November 25, 2026 11:01
An operation scope reports its first swallowed failure at the end, but
the thread's include-depth record holds only the newest one. Copy the
paths into the scope's failure record when it is recorded, so a hidden
submodule's depth failure is still thrown as ConfigIncludeDepthError
after later depth failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitFilters registration is process-wide, so the filter=* registration in
attributesFromHEAD also ran for a concurrently running suite's checkout and
failed its driver expectation there. It now passes other repositories' files
through and checks that it ran once for its own. SmudgeProbe owns its driver
name and ignores sources for any other driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@odrobnik

Copy link
Copy Markdown
Contributor Author

Agent summary

The change is ready for review.

@odrobnik odrobnik left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review of 65a2c2f. The earlier finding is fixed: a scope's first recorded failure lost its typed include-depth error once a later depth failure replaced the thread-local record. In 1aa59c6, gitkit_config_scope__record copies the include-depth paths into each scope failure at record time, but only when the record's message matches the failure's message. gitkit_config_scope_first_failure_include_depth uses the same iteration as _first_failure, so firstFailure() types the same failure it would otherwise return raw. Allocation failures are cleaned up and mark the failure as lost. __release frees the new strings. The new hiddenIncludeDepthFailureIsTyped test covers this case. The check() path still matches on both the class and the exact message, and that message includes both paths, so a stale thread-local record can't be attached to an unrelated error. The test-isolation changes to the filter and smudge probes only narrow the callbacks to their own sources. CI is green on all platforms. No new issues found.

👍 No findings.

Reviewed by Claude · opus

@odrobnik
odrobnik merged commit a0cf1d5 into main Nov 25, 2026
6 checks passed
@odrobnik
odrobnik deleted the agent/issue-119 branch November 25, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include depth error should carry the including and included paths (git's "exceeded maximum include depth" wording)

1 participant